﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.AutomaticInterferenceVolumeCreation.CUiAIVQConfirmDlg
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Tecnomatix.Engineering.Ui.WPF;


namespace DnProcessSimulateCommands.AutomaticInterferenceVolumeCreation;

public class CUiAIVQConfirmDlg : TxWindow, IComponentConnector
{
  internal System.Windows.Controls.Image warningIcon;
  internal CheckBox showAgainChkbox;
  private bool _contentLoaded;

  public CUiAIVQConfirmDlg(Window ownerCtrl)
  {
    ((Window) this).Owner = ownerCtrl;
    this.InitializeComponent();
    this.warningIcon.Source = this.WarningIcon;
  }

  public bool ShowAgain
  {
    get
    {
      bool? isChecked = this.showAgainChkbox.IsChecked;
      bool flag = false;
      return isChecked.GetValueOrDefault() == flag & isChecked.HasValue;
    }
  }

  private ImageSource WarningIcon
  {
    get
    {
      return (ImageSource) System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(SystemIcons.Question.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
    }
  }

  private void Button_Click(object sender, RoutedEventArgs e)
  {
    ((Window) this).DialogResult = new bool?(true);
  }

  private void Button_Click_1(object sender, RoutedEventArgs e)
  {
    ((Window) this).DialogResult = new bool?(false);
  }

  private void TxWindow_Loaded(object sender, RoutedEventArgs e)
  {
    Window owner = ((Window) this).Owner;
    ((Window) this).Left = owner.Left + (owner.Width - ((FrameworkElement) this).ActualWidth) / 2.0;
    ((Window) this).Top = owner.Top + (owner.Height - ((FrameworkElement) this).ActualHeight) / 2.0;
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  public void InitializeComponent()
  {
    if (this._contentLoaded)
      return;
    this._contentLoaded = true;
    Application.LoadComponent((object) this, new Uri("/DnProcessSimulateCommands;component/automaticinterferencevolumecreation/cuiaivqconfirmdlg.xaml", UriKind.Relative));
  }

  [DebuggerNonUserCode]
  [GeneratedCode("PresentationBuildTasks", "4.0.0.0")]
  [EditorBrowsable(EditorBrowsableState.Never)]
  void IComponentConnector.Connect(int connectionId, object target)
  {
    switch (connectionId)
    {
      case 1:
        ((FrameworkElement) target).Loaded += new RoutedEventHandler(this.TxWindow_Loaded);
        break;
      case 2:
        this.warningIcon = (System.Windows.Controls.Image) target;
        break;
      case 3:
        this.showAgainChkbox = (CheckBox) target;
        break;
      case 4:
        ((ButtonBase) target).Click += new RoutedEventHandler(this.Button_Click);
        break;
      case 5:
        ((ButtonBase) target).Click += new RoutedEventHandler(this.Button_Click_1);
        break;
      default:
        this._contentLoaded = true;
        break;
    }
  }
}
